import { reqPostSearchListData } from "../../api";
const state = {
  searchList: {},
};
const actions = {
  async postSearchListData(context,searchParams) {
    const result = await reqPostSearchListData(searchParams);
    console.log(result);
    if (result.code === 200) {
      context.commit("POST_SEARCH_LIST_DATA", result.data);
    } else {
      console.log(result.message);
    }
  },
};
const mutations = {
  POST_SEARCH_LIST_DATA(state, payload) {
    state.searchList = payload;
  },
};
const getters={
  attrsList(){
    return state.searchList.attrsList
  },
  goodsList(){
    return state.searchList.goodsList
  },
  trademarkList(){
    return state.searchList.trademarkList
  }
}
export default {
  namespaced: true,
  state,
  actions,
  mutations,
  getters
};
